import request from "@/utils/request";
const baseURL = process.env.VUE_APP_BASE_API
import { tansParams } from "@/utils/ruoyi";

export default {
  // return request({
  //   url: '/business/materialtest/listTree',
  //   method: 'get',
  //   data: data
  // })
  // 树形列表
  listTree: function () {
    return request({
      url: '/business/materialtest/listTree',
      method: 'get',
    })
  },
  // 初始化页面数据
  pageInitData: function (params) {
    return request({
      url: "/business/materialtest/pageInitData",
      method: "get",
      params: params,
    });
  },
  // 测试数据
  getDataByTestParam: function (params) {
    return request({
      url: "/business/materialtest/getDataByTestParam",
      method: "get",
      params: params,
    });
  },
  getParamListByMaterialID: function (params) {
    return request({
      url: "/business/materialtest/getParamListByMaterialID",
      method: "get",
      params: params,
    });
  },
  getDataFromListByParamID: function (params) {
    return request({
      url: "/business/materialtest/getDataFromListByParamID",
      method: "get",
      params: params,
    });
  },
  getDataByDataFrom: function (params) {
    return request({
      url: "/business/materialtest/getDataByDataFrom",
      method: "get",
      params: params,
    });
  },
  delDataByDataFrom: function (params) {
    return request({
      url: "/business/materialtest/delDataByDataFrom",
      method: "delete",
      params: params,
    });
  },
  impFromExcelByMaterialTypem: function (params) {
    return request({
      headers: {'Content-Type': 'multipart/form-data' },
      url: "/business/materialtest/impFromExcelByMaterialType",
      method: "post",
      data: params,
    });
  },
  expToExcelByMaterial: function (params) {
    let url = baseURL + "/business/materialtest/expToExcelByMaterial?" + tansParams(params)
    return url.slice(0, -1)
  }
};
